package com.atguigu.day08;

import com.atguigu.utils.ClickSource;
import org.apache.flink.runtime.state.filesystem.FsStateBackend;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Example1 {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        //每隔10秒钟，保存一次检查点
        env.enableCheckpointing(10 * 1000L);
        //设置保存检查点的文件夹的路径
        env.setStateBackend(new FsStateBackend("file:///D:\\code\\git\\yanzl_PC\\flinktutorial0701\\src\\main\\resources\\ckpts",false));

        env.addSource(new ClickSource()).print();


        env.execute();
    }
}
